In [3]:
import numpy as np
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
from pydelft.grd_dep import grd, dep
import re
from PyQt4 import QtGui
import sys
import os
import pandas as pd
% matplotlib inline
In [2]:
class bndFileDialog(QtGui.QMainWindow):
def __init__(self):
super(bndFileDialog, self).__init__()
fname = []
self.initUI()
def initUI(self):
self.setGeometry(300,300,350,300)
self.setWindowTitle('Open boundary definition file')
self.openfileDialog()
def openfileDialog(self):
fname = QtGui.QFileDialog.getOpenFileName(self, 'Open file', os.getcwd(), "BNT (*.bnd)")
self.fname = fname
In [ ]:
class bnd():
'''Delft3d boundary definition file'''
def __init__(self, fname=None):
self.read_bnd(fname)
def read_bnd(self, fname=None):
'''Read a Delft3d boundary definition file'''
if not fname:
app = QtGui.QApplication(sys.argv)
filedialog = bndFileDialog()
fname = filedialog.fname
else:
fname = fname
pd.read
In [22]:
fname = r'i:\Japan\Data\Sendai\T3\create_riemann\testing\run7\natori_10_v2.bnd'
column_names = ['name','type','forcing','m1','n1','m2','n2',
'reflection coefficient','vertical profile',
'label1','label2']
data = pd.read_csv(fname, delim_whitespace=True,header=None,
names = column_names)
data[0:15]
Out[22]:
In [ ]: